<?php
class Pageley_Log_FactoryTests extends Pageley_Test_Case {
	
	public function testGetLogger() {
        $factory = Pageley_Log_Factory::getInstance();
        $factory->setLevels(new Pageley_Util_ArrayMap(array(
            "Pageley_Log_FactoryTests_Sub1" => Pageley_Log_Level::$DEBUG,
            "Pageley_Log_FactoryTests" => Pageley_Log_Level::$INFO,
            "Pageley_Log_FactoryTests_Sub2" => Pageley_Log_Level::$WARN
        )));
        $logger = $factory->getLogger("Pageley_Log_FactoryTests_Sub1_TestClass");
        $this->assertTrue($logger->isDebugEnabled());
        $logger = $factory->getLogger("Pageley_Log_FactoryTests_TestClass");
        $this->assertFalse($logger->isDebugEnabled());
        $this->assertTrue($logger->isInfoEnabled());
        $logger = $factory->getLogger("Pageley_Log_FactoryTests_Sub2_TestClass");
        $this->assertFalse($logger->isInfoEnabled());
	}
}